package com.jk.vehicle.mini.entity;

import com.jk.vehicle.core.entity.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import lombok.Data;

@Table(name = "mileage_statistics_week")
@Data
public class MileageStatisticsWeek extends BaseEntity {
    /**
     * 里程数
     */
    private BigDecimal mileage;

    /**
     * 总骑行时间（秒）
     */
    @Column(name = "ride_time")
    private Long rideTime;

    /**
     * 平均速度km/h
     */
    @Column(name = "avg_speed")
    private BigDecimal avgSpeed;

    /**
     * 最高速度
     */
    @Column(name = "top_speed")
    private BigDecimal topSpeed;

    /**
     * 其他统计数据，json格式
     */
    @Column(name = "other_data")
    private String otherData;

    /**
     * 统计周
     */
    @Column(name = "record_week")
    private Integer recordWeek;

    /**
     * 开始日期
     */
    @Column(name = "start_date")
    private Date startDate;

    /**
     * 结束日期
     */
    @Column(name = "end_date")
    private Date endDate;

    /**
     * 车辆id
     */
    @Column(name = "bicycle_id")
    private Long bicycleId;

    /**
     * 开始时间
     */
    @Column(name = "create_date")
    private Date createDate;

    /**
     * 更新时间
     */
    @Column(name = "update_date")
    private Date updateDate;

    public static final class MileageStatisticsWeekBuilder {
        private BigDecimal mileage;
        private Long rideTime;
        private Long id;
        private Byte delFlag = 0;
        private BigDecimal avgSpeed;
        private BigDecimal topSpeed;
        private String otherData;
        private Integer recordWeek;
        private Date startDate;
        private Date endDate;
        private Long bicycleId;
        private Date createDate;
        private Date updateDate;

        private MileageStatisticsWeekBuilder() {
        }

        public static MileageStatisticsWeekBuilder aMileageStatisticsWeek() {
            return new MileageStatisticsWeekBuilder();
        }

        public MileageStatisticsWeekBuilder withMileage(BigDecimal mileage) {
            this.mileage = mileage;
            return this;
        }

        public MileageStatisticsWeekBuilder withRideTime(Long rideTime) {
            this.rideTime = rideTime;
            return this;
        }

        public MileageStatisticsWeekBuilder withId(Long id) {
            this.id = id;
            return this;
        }

        public MileageStatisticsWeekBuilder withDelFlag(Byte delFlag) {
            this.delFlag = delFlag;
            return this;
        }

        public MileageStatisticsWeekBuilder withAvgSpeed(BigDecimal avgSpeed) {
            this.avgSpeed = avgSpeed;
            return this;
        }

        public MileageStatisticsWeekBuilder withTopSpeed(BigDecimal topSpeed) {
            this.topSpeed = topSpeed;
            return this;
        }

        public MileageStatisticsWeekBuilder withOtherData(String otherData) {
            this.otherData = otherData;
            return this;
        }

        public MileageStatisticsWeekBuilder withRecordWeek(Integer recordWeek) {
            this.recordWeek = recordWeek;
            return this;
        }

        public MileageStatisticsWeekBuilder withStartDate(Date startDate) {
            this.startDate = startDate;
            return this;
        }

        public MileageStatisticsWeekBuilder withEndDate(Date endDate) {
            this.endDate = endDate;
            return this;
        }

        public MileageStatisticsWeekBuilder withBicycleId(Long bicycleId) {
            this.bicycleId = bicycleId;
            return this;
        }

        public MileageStatisticsWeekBuilder withCreateDate(Date createDate) {
            this.createDate = createDate;
            return this;
        }

        public MileageStatisticsWeekBuilder withUpdateDate(Date updateDate) {
            this.updateDate = updateDate;
            return this;
        }

        public MileageStatisticsWeek build() {
            MileageStatisticsWeek mileageStatisticsWeek = new MileageStatisticsWeek();
            mileageStatisticsWeek.setMileage(mileage);
            mileageStatisticsWeek.setRideTime(rideTime);
            mileageStatisticsWeek.setId(id);
            mileageStatisticsWeek.setDelFlag(delFlag);
            mileageStatisticsWeek.setAvgSpeed(avgSpeed);
            mileageStatisticsWeek.setTopSpeed(topSpeed);
            mileageStatisticsWeek.setOtherData(otherData);
            mileageStatisticsWeek.setRecordWeek(recordWeek);
            mileageStatisticsWeek.setStartDate(startDate);
            mileageStatisticsWeek.setEndDate(endDate);
            mileageStatisticsWeek.setBicycleId(bicycleId);
            mileageStatisticsWeek.setCreateDate(createDate);
            mileageStatisticsWeek.setUpdateDate(updateDate);
            return mileageStatisticsWeek;
        }
    }
}